# -*- coding: utf-8 -*-
"""
Created on Sun Dec 29 13:51:08 2019

@author: JimmyMo
"""

import tensorflow as tf
print(tf.__version__)
# hello = tf.constant("Hello Tensorflow!")
# print(hello)
# sess = tf.compat.v1.Session()
# print(sess.run(hello))

## TF 2.0 supports eager execution which means you don't have to explicitly create a session and run the code in it
# a = tf.constant([1.0, 2.0], name="a")
# b = tf.constant([2.0, 3.0], name="b")

# result = a + b
# print(result)

# TF 1.x session mode
with tf.compat.v1.Session() as sess:
    a = tf.constant([1.0, 2.0], name="a")
    b = tf.constant([2.0, 3.0], name="b")
    result = a + b
    # print(result.eval())
    print(sess.run(result))